# -*- coding:utf-8 -*-
import sys
import os
import xIPC
import time

if __name__ == "__main__":
	xIPC_obj = xIPC.xIPCLoader("xIPC.dll")
	xIPC_obj.init_xIPC()
	pipe_obj = xIPC.Pipe(xIPC_obj)
	pipe_obj.open("127.0.0.1", 4450, "B", "A")
	#time.sleep(10)
	while True:
		s = pipe_obj.waitbytes(3, 10000)
		if s is None:
			time.sleep(1)
			continue
		print(s)
	pipe_obj.close()
	xIPC_obj.deinit_xIPC()